#include <bits/stdc++.h>
#define int long long
using namespace std;

const int N = 1e5 + 5;
int a[N],r,n,ans,Max;

int add;

struct node{
    int used,real;
}x[N];

int cnt;

signed main(){
    freopen("duel.in","r",stdin);
    freopen("duel.out","w",stdout);
    cin>>n;
    for(int i=1;i<=n;i++){
        cin>>r;
        Max = max(r,Max);
        a[r] ++;
    }
    for(int i=1;i<=Max;i++){
        if(a[i] == 0) continue;
        x[++cnt].real = a[i];
    }
    for(int i=1;i<cnt;i++){
        int tmp = x[i].real;
        x[i].real = max(0 * 1ll,x[i].real - x[i + 1].real);
        if(x[i].real == 0 * 1ll){
            int last = min(add,x[i + 1].real - tmp);
            add -= last;
        }
        add += x[i].real;
    }
    ans = x[cnt].real + add;
    cout<<ans<<endl;
    return 0;
}
